<template>
  <div class="content-info">
    <!-- 图片 -->
    <div class="pic">
      <van-image lazy-load :src="img_url" height="190" width="120">
        <template v-slot:loading>
          <img class="load" src="@/assets/goImages/8P.png" alt="" />
        </template>
      </van-image>
    </div>
    <!-- 描述信息 -->
    <div class="content-desc">
      <span class="desc-title">{{ desc_title }}</span>
      <div class="desc" v-for="(d, i) in desc" :key="i">{{ d }}</div>
      <!-- 价格 -->
      <div class="go-pay">
        <div class="price-box">
          <span class="price">￥{{ price }}{{ price_suffix }}</span>
          <div class="plus" v-if="plus_price">
            <span class="plus-icon">
              <van-icon size="16px" color="#C7993A" name="arrow-down" />
            </span>
            <span class="plus-price">￥{{ plus_price }}{{ price_suffix }}</span>
          </div>
        </div>
        <!-- 购买按钮 -->
        <div class="pay-btn" @click="$router.push('/feeds/' + feed_id)">
          <img src="@/assets/goImages/pay-btn.png" alt="" />
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    feed_id: Number,
    img_url: String,
    desc_title: String,
    desc: Array,
    price: String,
    plus_price: String,
    price_suffix: String
  }
}
</script>

<style lang="less" scoped>
.content-info {
  margin-top: 10px;
  padding-bottom: 15px;
  display: flex;

  .pic {
    height: 200px;
    width: 120px;
    img.load {
      height: 100%;
      width: 100%;
    }
  }
  .content-desc {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding-left: 10px;

    .desc-title {
      max-width: 225px;
      font-size: 14px;
      font-weight: 600;
      line-height: 24px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .desc {
      font-size: 12px;
      font-weight: normal;
      color: #777;
      line-height: 20px;
      overflow: hidden;
      text-overflow: ellipsis; /*显示为......*/
      -webkit-line-clamp: 2; /*显示为两行，在第二行中显示为.......*/
      display: -webkit-box;
      -webkit-box-orient: vertical;
    }

    .go-pay {
      display: flex;
      margin-top: 15px;
      padding-right: 10px;
      justify-content: flex-end;

      .price-box {
        margin-right: 10px;
        font-size: 14px;
        align-items: inherit;
        display: inherit;
        flex-direction: column;

        .price {
          text-align: right;
          color: #1d1c1b;
          font-weight: 600;
        }
        .plus-icon {
          height: 16px;
          width: 16px;
          margin-right: 5px;
          background-color: #1d1c1b;
          border-radius: 999px;

          .van-icon {
            font-weight: 700;
            transform: scale(0.6, 1.2);
          }
        }
        .plus-price {
          font-weight: 600;
          color: #c7993a;
        }
      }

      .pay-btn {
        width: 100px;
        height: 30px;

        img {
          height: 100%;
          width: 100%;
        }
      }
    }
  }
}
</style>
